]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
polkitAgent: Hide authentication dialogs while locked
authorFlorian Müllner <fmuellner@gnome.org>
Thu, 12 Apr 2018 17:25:37 +0000 (19:25 +0200)
committerFlorian Müllner <fmuellner@gnome.org>
Fri, 13 Apr 2018 17:35:31 +0000 (19:35 +0200)
Since commit 78a92fb6be we no longer pop up authentication dialogs
on the lock screen, however any dialog that is already open at that
time remains open. This is unexpected, so hide the dialog until
the screen is unlocked again.

https://gitlab.gnome.org/GNOME/gnome-shell/issues/166

js/ui/components/polkitAgent.js

index d14d9d3ac7c2f6917036f2d5931a6b9239e52e3c..316bc2ad186496041aa3088e636a113b4ac871ef 100644 (file)
@@ -40,6 +40,10 @@ var AuthenticationDialog = new Lang.Class({
         this.userNames = userNames;
         this._wasDismissed = false;
 
+        this._sessionUpdatedId = Main.sessionMode.connect('updated', () => {
+            this._group.visible = !Main.sessionMode.isLocked;
+        });
+
         let icon = new Gio.ThemedIcon({ name: 'dialog-password-symbolic' });
         let title = _("Authentication Required");
 
@@ -194,6 +198,12 @@ var AuthenticationDialog = new Lang.Class({
         this._session.initiate();
     },
 
+    close(timestamp) {
+        this.parent(timestamp);
+
+        Main.sessionMode.disconnect(this._sessionUpdatedId);
+    },
+
     _ensureOpen() {
         // NOTE: ModalDialog.open() is safe to call if the dialog is
         // already open - it just returns true without side-effects